package com.eps.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author CAROLINA
 */
@Entity
@Table(name = "Ambiente")
@NamedQueries({@NamedQuery(name = "Ambiente.findAll", query = "SELECT a FROM Ambiente a"), @NamedQuery(name = "Ambiente.findByIdAmbiente", query = "SELECT a FROM Ambiente a WHERE a.idAmbiente = :idAmbiente"), @NamedQuery(name = "Ambiente.findByIdSubAlmacen", query = "SELECT a FROM Ambiente a WHERE a.idSubAlmacen = :idSubAlmacen"), @NamedQuery(name = "Ambiente.findByDescripcion", query = "SELECT a FROM Ambiente a WHERE a.descripcion = :descripcion")})
public class Ambiente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_Ambiente")
    private Long idAmbiente;
    @Column(name = "id_SubAlmacen")
    private String idSubAlmacen;
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(mappedBy = "idAmbiente")
    private List<Pabellon> pabellonList;

    public Ambiente() {
    }

    public Ambiente(Long idAmbiente) {
        this.idAmbiente = idAmbiente;
    }

    public Long getIdAmbiente() {
        return idAmbiente;
    }

    public void setIdAmbiente(Long idAmbiente) {
        this.idAmbiente = idAmbiente;
    }

    public String getIdSubAlmacen() {
        return idSubAlmacen;
    }

    public void setIdSubAlmacen(String idSubAlmacen) {
        this.idSubAlmacen = idSubAlmacen;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public List<Pabellon> getPabellonList() {
        return pabellonList;
    }

    public void setPabellonList(List<Pabellon> pabellonList) {
        this.pabellonList = pabellonList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAmbiente != null ? idAmbiente.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {

        if (!(object instanceof Ambiente)) {
            return false;
        }
        Ambiente other = (Ambiente) object;
        if ((this.idAmbiente == null && other.idAmbiente != null) || (this.idAmbiente != null && !this.idAmbiente.equals(other.idAmbiente))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.Ambiente[idAmbiente=" + idAmbiente + "]";
    }

}
